Report of all Teams that need to update Schedule and/or Escalation Policies?

Is there a way to pull a report that lists all Teams and includes if they need to Replace Inactive Users within Schedules and/or Escalation Policies?

I’ve been tasked with notifying all teams within my organization that have broken schedules and escalation policies. With over 3,800 teams I would love a spreadsheet to work off of rather than opening each team individually within the web browser to check their settings.

Team User Page:

Team Schedules:

Team Escalation Policies:

Any advice would be much appreciated!

Are you comfortable scripting and using our REST API?

You may also use: https://github.com/martindstone/pagerduty-cli
NB: As mentioned in this repo, it’s not a PagerDuty supported tool … but it works quite well.

I didn’t check if it fits your use case. But it helps to do many actions as from the UI/API and it’s easy for bash/zsh scripting.

@dmcclure I am also interested in this same question, and am comfortable with using the REST API. I’ve taken a quick look at it, but if you have any pointers to get me started (or an existing resource you can point me to) I would be grateful.

Let’s say you have an EP with and deleted and inactive user. First, do a GET On the EP, then look at the escalation rules -> escalation targets section and you’ll see the users or schedules targets.

For the deleted/inactive user, the field “self” will be blank/null and you can use this condition to break out into logic to remove and update the EP. It will be the same for deleted/inactive users on a schedule.

"escalation_rules": [
  {
    "id": "PANZZEQ",
    "escalation_delay_in_minutes": 30,
    "targets": [
      {
        "id": "PEYSGVF",
        "summary": "PagerDuty Admin",
        "type": "user_reference",
        "self": "https://api.pagerduty.com/users/PEYSGVF",
        "html_url": "https://subdomain.pagerduty.com/users/PEYSGVF"
      },
      {
        "id": "PEYSGVF",
        "summary": "joe deleted",
        "type": "user_reference",
        "self": "",
        "html_url": "https: subdomain.pagerduty.com/users/PEYSGVF"
      },
      {
        "id": "PI7DH85",
        "summary": "DailyEngineeringRotation",
        "type": "schedule_reference",
        "self": "https: //api.pagerduty.com/schedules/PI7DH85",
        "html_url": "https: subdomain.pagerduty.com/schedules/PI7DH85"
      }
    ]
  }
]